Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI to check that the provider compiles #105

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Dec 26, 2023

This PR changes the hypothetical provider to an actual empty provider so the template compiles as is. It then checks compilation by running golangci-lint on the provider.

Compile failures will now fail CI.

Inspired by #101

@iwahbe iwahbe self-assigned this Dec 26, 2023
@iwahbe iwahbe added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Dec 26, 2023
@iwahbe iwahbe force-pushed the iwahbe/check-provider-compiles-in-ci branch 4 times, most recently from 78c9681 to 020474b Compare December 26, 2023 20:59
This is necessary to prevent regressions like #101.
@iwahbe iwahbe force-pushed the iwahbe/check-provider-compiles-in-ci branch from 020474b to 9f1974e Compare December 26, 2023 21:03
@iwahbe iwahbe changed the title Add CI to confirm the provider compiles Add CI to check that the provider compiles Dec 26, 2023
@iwahbe iwahbe requested a review from a team December 26, 2023 21:07
- lll
- megacheck
- misspell
- nakedret
- structcheck
- revive
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here allow the linter to trigger without warnings on deprecated linters.

run: |
git grep -l 'go:embed' -- provider | xargs sed -i 's/go:embed/ goembed/g'
- name: prepare upstream
continue-on-error: true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why continue on error here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the Makefile might not define an upstream target. If it does, then it is assumed to be necessary to compile the provider. If make upstream exists and fails, it is assumed the next step will fail.

@iwahbe iwahbe merged commit d2730b3 into main Dec 27, 2023
2 checks passed
@iwahbe iwahbe deleted the iwahbe/check-provider-compiles-in-ci branch December 27, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants